Skip to main content

Overview

  • An in-memory data store (key-value store ) making it very fast at accessing data
  • Very versatile and simple to use
  • Offers a wide range of features which resemble popular data structures (hashes, set, queue, etc)
  • Also support communication patterns like Pub/sub and Streams, making it also a good option for job queue or real-time application
  • Read more: https://www.hellointerview.com/learn/system-design/deep-dives/redis

Usage Patterns

Cache

  • Most common usage
  • Map between itemId - itemObject to improve read speed
  • Often employ a time to live (TTL) on each key. Redis guarantees you'll never read the value of a key after the TTL has expired and the TTL is used to decide which items to remove from the server (this is different from eviction strategy).

Distributed Lock

  • Common use case
  • Important pattern
  • When we have data in system and need to maintain consistency during updates
  • Or when we need to make sure multiple actor aren't performing an action on a resource at the same time

Rate Limit

Event Sourcing